Skip to content

[Python] Only use Python Limited C API in ROOT Pythonizations library#21766

Merged
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:limited_api
Apr 9, 2026
Merged

[Python] Only use Python Limited C API in ROOT Pythonizations library#21766
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:limited_api

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

This follows up on 4e0c7bf, swapping out the remaining use of CPython API functions that were not inside the limited API.

In the cases where we're sill using private headers from cppyy, the parts of these headers that don't compile with the limited API are excluded via the Py_LIMITED_API preprocessor macro.

@guitargeek guitargeek self-assigned this Apr 1, 2026
@guitargeek guitargeek force-pushed the limited_api branch 3 times, most recently from 94ced7a to 3380aef Compare April 1, 2026 20:53
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

Test Results

    22 files      22 suites   3d 4h 25m 48s ⏱️
 3 831 tests  3 830 ✅  1 💤 0 ❌
76 513 runs  76 495 ✅ 18 💤 0 ❌

Results for commit 4003e51.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the overall direction! I have two minor comments that need clarification before moving on.

Comment thread bindings/pyroot/pythonizations/src/TClassPyz.cxx Outdated
Comment thread bindings/pyroot/pythonizations/src/TClassPyz.cxx Outdated
This follows up on 4e0c7bf, swapping out the remaining use of
CPython API functions that were not inside the limited API.

In the cases where we're sill using private headers from cppyy, the
parts of these headers that don't compile with the limited API are
excluded via the `Py_LIMITED_API` preprocessor macro.
@guitargeek
Copy link
Copy Markdown
Contributor Author

Thanks for the review @vepadulano! I have updated the PR

@guitargeek
Copy link
Copy Markdown
Contributor Author

guitargeek commented Apr 8, 2026

Just to try it out, I made the experiment of building libROOTPythonizations.so with Python 3.12, and then I ran the unit tests with Python 3.14, and the pythonizations unit tests work. So seems we are not missing anything else!

Copy link
Copy Markdown
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool stuff thanks!

Comment thread bindings/pyroot/cppyy/CPyCppyy/src/Utility.h
@guitargeek guitargeek merged commit d5a74fa into root-project:master Apr 9, 2026
29 of 30 checks passed
@guitargeek guitargeek deleted the limited_api branch April 9, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants